Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error message from FindDotNetCliPackage task #6630

Merged
2 commits merged into from
Dec 2, 2020

Conversation

alexperovich
Copy link
Member

https://github.com/dotnet/core-eng/issues/11538

With this change issues like dotnet/runtime#44541 will now be much more clear.

{
var extension = Runtime.StartsWith("win") ? "zip" : "tar.gz";
if (PackageType == "sdk")
catch (HttpRequestException ex) when (ex.Message.Contains("404 (Not Found)")) // 404 means that we successfully hit the server, and it returned 404. This cannot be a network hick-up
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
catch (HttpRequestException ex) when (ex.Message.Contains("404 (Not Found)")) // 404 means that we successfully hit the server, and it returned 404. This cannot be a network hick-up
catch (HttpRequestException ex) when (ex.Message.Contains("404 (Not Found)")) // 404 means that we successfully hit the server, and it returned 404. This cannot be a network hiccup

{
var extension = Runtime.StartsWith("win") ? "zip" : "tar.gz";
if (PackageType == "sdk")
catch (HttpRequestException ex) when (ex.Message.Contains("404 (Not Found)")) // 404 means that we successfully hit the server, and it returned 404. This cannot be a network hick-up
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would REALLY rather we check the result code on line 59, rather than parse the error message. Usually it's a pain to do that, so the catch is ok... but it's just 2 lines higher, and avoid the message parsing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: hiccup.

@alexperovich alexperovich added the auto-merge Automatically merge PR once CI passes. label Dec 1, 2020
@ghost
Copy link

ghost commented Dec 1, 2020

Hello @alexperovich!

Because this pull request has the auto-merge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit a4468a5 into dotnet:master Dec 2, 2020
@alexperovich alexperovich deleted the FixErrorMessage branch December 2, 2020 21:23
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-merge Automatically merge PR once CI passes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants